package com.ssm.dao;

import com.github.pagehelper.Page;
import com.ssm.base.BaseDao;
import com.ssm.entity.UserFollow;
import com.ssm.vo.UserFollowVo;
import org.apache.ibatis.annotations.Param;

/**
 * @Author jie_ge
 * @Date 2022/4/21
 */
public interface UserFollowDao extends BaseDao<UserFollow> {
    /**
     * 关注房源
     * @param userId
     * @param houseId
     */
    void follow(Long userId,Long houseId);

    /**
     * 判断是否关注了
     * @param userId
     * @param houseId
     * @return
     */
    Integer countByUserIdAndHouseId(@Param("userId") Long userId,@Param("houseId") Long houseId);
    /**
     * 我的关注
     * @param userId
     * @return
     */
    Page<UserFollowVo> findListPage(@Param("userId") Long userId);
    /**
     * 取消关注
     * @param id
     */
    void cancelFollow(Long id);
}
